//
//  YUSearchViewController.swift
//  tuniu
//
//  Created by 于世民 on 2019/8/8.
//  Copyright © 2019 于世民. All rights reserved.
//

import UIKit
import RxCocoa
import RxSwift

class YUSearchViewController: YUBaseViewController {
    
    let disposeBag = DisposeBag()
    let sub1 = BehaviorSubject(value: "A")
    let sub2 = BehaviorSubject(value: "1")

    override func viewDidLoad() {
        super.viewDidLoad()
        let variable = Variable(sub1)
        
    
        let des = variable.asObservable()
                .flatMap{ $0 }
    
        variable.value = sub2
        
        des.subscribe(onNext: {
          print($0)
        }).disposed(by: disposeBag)
        
      
    }
    
}
